home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
MacGzip 1.0
/
source
/
Mac
/
testw.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-21
|
1KB
|
87 lines
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "MacIO.h"
#ifdef MPW
QDGlobals qd;
#endif
/*
* Let's go
*/
int main()
{
StandardFileReply mySFR;
FSSpec *myFSSpec;
OSErr error;
SFTypeList typeList={ 'PICT','JFIF','JPEG','\?\?\?\?' };
FILE *g;
char buffer[100];
int fd;
int count;
MaxApplZone();
FlushEvents(everyEvent, 0);
InitGraf(&qd.thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(0);
InitCursor();
StandardPutFile( "\pMierda pa ti", "\pJódete", &mySFR);
if( mySFR.sfGood )
{
myFSSpec = &mySFR.sfFile;
if( mySFR.sfReplacing );
fs_unlink( myFSSpec );
/* should test OSErr and all that shit */
/* fd = fs_open( myFSSpec, OM_WRONLY | OM_BINARY );*/
/*g=fopen("mierda puta.raw", "rb");*/
/* fd = fs_open( myFSSpec, OM_WRONLY | OM_TEXT );*/
/*g=fopen("mierda puta.asc", "rb");*/
fd = fs_open( myFSSpec, OM_WRONLY | OM_MACBINARY );
/*g=fopen("mierda puta.bin", "rb");*/
g=fopen("coño.bin", "rb");
while( TRUE )
{
count = fread(buffer,1,sizeof(buffer),g);
if (count != 0 )
if ( count != fs_write( fd, buffer, count))
break;
if ( count != sizeof(buffer) )
break;
}
fs_close(fd);
fclose(g);
}
return EXIT_SUCCESS;
}